package com.harzone.commons.search.domain;


/**
 * 聚合函数
 * @author ls
 * 2014年11月24日下午12:36:14
 */
public enum AFunctions {
	  COUNT("COUNT")
	 ,SUM("SUM")
	 ,MAX("MAX")
	 ,MIN("MIN")
	 ,AVG("AVG")
	 ,TOPHITS("TOPHITS")
	 ,UNKWON("UNKWON");
	 
	private String name = "";
	
	private AFunctions(String name){
		  this.name = name;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	 
	public static AFunctions get(String name){
		AFunctions[]  afs = AFunctions.values();
		for (AFunctions aFunctions : afs) {
			if(aFunctions.getName().equals(name)){
				return aFunctions;
			}
		}
		return UNKWON;
	}
	 
}
